package org.example.minebackend.pojo.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.example.minebackend.pojo.Invitation;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class InvitationDTO {
    private int id;
    private String writer;
    private int writerId;
    private String title;
    private String content;
    private String kind;
    @JsonProperty("nOfCollections")
    private int nOfCollections;
    private LocalDateTime createTime;
    public InvitationDTO(Invitation invitation, String writer) {
        id = invitation.getId();
        this.writer = writer;
        writerId = invitation.getWriterId();
        title = invitation.getTitle();
        content = invitation.getContent();
        kind = invitation.getKind();
        nOfCollections = invitation.getNOfCollections();
        createTime = invitation.getCreateTime();
    }
}
